#include<bits/stdc++.h>
#define sd(n) scanf("%d",&n) 
#define sld(n) scanf("%lld",&n)
#define pd(n) printf("%d", (n))
#define pld(n) printf("%lld", n)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define fi first
#define se second
const int N=2e5;
#define INF 0x7fffffff
typedef long long int ll;
using namespace std;
//----------------------------------------------------------------------------//
int a,b;//a num of 0,b num of 1
void solve()
{
	int is_zero=true;
	sd(a);sd(b);
	while(a&&b)
	{
		if(is_zero&&a)
		{
			//cout<<0<<" ";
			pd(0);
			a--;is_zero=false;
		}
		else
		{
			//cout<<1<<" ";
			pd(1);
			b--;is_zero=true;
		}
	}
	if(a>0)
	{
		while(a--) pd(0);//cout<<0<<" ";
	}
	if(b>0)
	{
		while(b--) pd(1);//cout<<1<<" ";
	}
	puts("");
}

int main()
{
	int T;
	sd(T);
	while (T--)
	{
		solve();
	}
	return 0;
}